package com.dsj.gxrd.modules.book.domain.dto;

import com.dsj.gxrd.modules.book.domain.dto.RdFileDto;
import com.dsj.gxrd.modules.book.domain.groups.Group01;
import com.dsj.gxrd.modules.book.domain.groups.Group02;
import com.dsj.gxrd.modules.book.domain.groups.Group03;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author songpin566
 * @date 2023/09/14
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description = "交流分享")
public class RdCommShareDto {

    @ApiModelProperty("id")
    @JsonSerialize(using = ToStringSerializer.class)
    @NotNull(message = "id不能为null", groups = Group02.class)
    private Long rdCommShareId;

    @ApiModelProperty("标题")
    @NotBlank(message = "标题不能为空", groups = {Group01.class, Group02.class})
    private String title;

    @ApiModelProperty("内容")
    @NotBlank(message = "请填写内容", groups = {Group01.class, Group02.class})
    private String content;

    @ApiModelProperty("分享人")
    //@Size(min=1,max=50,message="分享人名字长度在1-50之间",groups = {Group01.class, Group02.class})
    private String sharePerson;

/*    @ApiModelProperty("审批状态")
//    @Pattern(regexp="[1|2]",message="审批状态值异常",groups = Group02.class)
    @Min(value = 0, message = "审批状态值异常", groups = {Group02.class, Group03.class})
    @Max(value = 2, message = "审批状态值异常", groups = {Group02.class, Group03.class})
    private Integer approvalStatus;*/

    private RdFileDto file;

    @ApiModelProperty("备注")
    private String remark;

}
